package com.qq.weixin.mp.message.hxexp.model.receive;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

import com.hxexp.weixin.common.jaxb.CDATAAdapter;
/**
 * 接收的文本消息
 *
 * @author li.jiang
 *
 */
@XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD)
public final class TextMsgJaxb extends BaseMsgJaxb {

    private static final long serialVersionUID = -7004302976729614676L;
    /**
     * 文本消息内容
     */
    @XmlElement(name = "Content")
    @XmlJavaTypeAdapter(value=CDATAAdapter.class)
    private String content;
    /**
     * 消息id，64位整型
     */
    @XmlElement(name = "MsgId")
    private long msgId;
    /**
     * 文本消息构造函数
     */
    public TextMsgJaxb() {
    }

    /**
     * @return the content
     */
    public String getContent() {
        return content;
    }

    /**
     * @param content
     *            the content to set
     */
    public void setContent(String content) {
        this.content = content;
    }
    /**
     * @return the msgId
     */
    public long getMsgId() {
        return msgId;
    }

    /**
     * @param msgId the msgId to set
     */
    public void setMsgId(long msgId) {
        this.msgId = msgId;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return String
                .format("TextMsgJaxb [content=%s, msgId=%s, getToUserName()=%s, getFromUserName()=%s, getCreateTime()=%s, getMsgType()=%s]",
                        content, msgId, getToUserName(), getFromUserName(), getCreateTime(), getMsgType());
    }
}
